﻿<UserControl x:Class="Ewav.Unmatched"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:GadgetSelector="clr-namespace:Ewav.ContextMenu;assembly=Ewav.ContextMenu.Menu"
	xmlns:Common="clr-namespace:CommonLibrary;assembly=CommonLibrary"
	mc:Ignorable="d"
	d:DesignHeight="500" d:DesignWidth="900"
	xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
	xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
	xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
			 xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows">

	<UserControl.Resources>
		<Style x:Key="GlassButton" TargetType="Button">
			<Setter Property="Background" Value="#FF1F3B53"/>
			<Setter Property="Foreground" Value="#FF000000"/>
			<Setter Property="Padding" Value="3"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="BorderBrush">
				<Setter.Value>
					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
						<GradientStop Color="#FFA3AEB9" Offset="0"/>
						<GradientStop Color="#FF8399A9" Offset="0.375"/>
						<GradientStop Color="#FF718597" Offset="0.375"/>
						<GradientStop Color="#FF617584" Offset="1"/>
					</LinearGradientBrush>
				</Setter.Value>
			</Setter>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid>
							<vsm:VisualStateManager.VisualStateGroups>
								<vsm:VisualStateGroup x:Name="CommonStates">
									<vsm:VisualState x:Name="Normal"/>
									<vsm:VisualState x:Name="MouseOver">
										<Storyboard>
											<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="glow" Storyboard.TargetProperty="(UIElement.Opacity)">
												<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
											</DoubleAnimationUsingKeyFrames>
										</Storyboard>
									</vsm:VisualState>
									<vsm:VisualState x:Name="Pressed">

										<Storyboard>
											<ColorAnimationUsingKeyFrames Storyboard.TargetName="border" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
												<SplineColorKeyFrame KeyTime="0" Value="#CC000000"/>
											</ColorAnimationUsingKeyFrames>
											<DoubleAnimationUsingKeyFrames Storyboard.TargetName="shine" Storyboard.TargetProperty="Opacity">
												<SplineDoubleKeyFrame KeyTime="0" Value="0.4"/>
											</DoubleAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="glow" 
												Storyboard.TargetProperty="(UIElement.Visibility)">
												<DiscreteObjectKeyFrame KeyTime="00:00:00">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Collapsed</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</vsm:VisualState>
									<vsm:VisualState x:Name="Disabled">
										<!-- <Storyboard>
											<DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
												<SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
											</DoubleAnimationUsingKeyFrames>
										</Storyboard> -->
									</vsm:VisualState>
								</vsm:VisualStateGroup>
								<vsm:VisualStateGroup x:Name="FocusStates">
									<vsm:VisualState x:Name="Focused">
										<!--<Storyboard>
											<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="glow" Storyboard.TargetProperty="(UIElement.Opacity)">
												<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
											</DoubleAnimationUsingKeyFrames>
										</Storyboard>-->
									</vsm:VisualState>
									<vsm:VisualState x:Name="Unfocused"/>
								</vsm:VisualStateGroup>
							</vsm:VisualStateManager.VisualStateGroups>
							<Border BorderBrush="#FFFFFFFF" BorderThickness="1,1,1,1" CornerRadius="4,4,4,4">
								<Border x:Name="border" Background="#7F000000" BorderBrush="#FFA2A2B5" BorderThickness="1,1,1,1" CornerRadius="4,4,0,0">
									<Grid>
										<Grid.RowDefinitions>
											<RowDefinition Height="0.507*"/>
											<RowDefinition Height="0.493*"/>
										</Grid.RowDefinitions>
										<Border Opacity="0" HorizontalAlignment="Stretch" x:Name="glow" Width="Auto" Grid.RowSpan="2" CornerRadius="4,4,4,4">
											<Border.Background>
												<RadialGradientBrush>
													<RadialGradientBrush.RelativeTransform>
														<TransformGroup>
															<ScaleTransform ScaleX="1.702" ScaleY="2.243"/>
															<SkewTransform AngleX="0" AngleY="0"/>
															<RotateTransform Angle="0"/>
															<TranslateTransform X="-0.368" Y="-0.152"/>
														</TransformGroup>
													</RadialGradientBrush.RelativeTransform>
													<GradientStop Color="#B28DBDFF" Offset="0"/>
													<GradientStop Color="#008DBDFF" Offset="1"/>
												</RadialGradientBrush>
											</Border.Background>
										</Border>
										<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Width="Auto" Grid.RowSpan="2"/>
										<Border HorizontalAlignment="Stretch" Margin="0,0,0,0" x:Name="shine" Width="Auto" CornerRadius="4,4,0,0">
											<Border.Background>
												<LinearGradientBrush EndPoint="0.494,0.889" StartPoint="0.494,0.028">
													<GradientStop Color="#99FFFFFF" Offset="0"/>
													<GradientStop Color="#33FFFFFF" Offset="1"/>
												</LinearGradientBrush>
											</Border.Background>
										</Border>
									</Grid>
								</Border>
							</Border>

						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Storyboard x:Name="expand">
			<PointAnimationUsingKeyFrames BeginTime="00:00:00" 
				  Storyboard.TargetName="popupMenu" 
				  Storyboard.TargetProperty="(UIElement.Clip).(PathGeometry.Figures)[0].(PathFigure.Segments)[0].(LineSegment.Point)"
			SpeedRatio="3">
				<SplinePointKeyFrame KeyTime="00:00:00" Value="0,0"/>
				<SplinePointKeyFrame KeyTime="00:00:01" Value="60,0"/>
			</PointAnimationUsingKeyFrames>

			<PointAnimationUsingKeyFrames BeginTime="00:00:00" 
				  Storyboard.TargetName="expandEffect" 
				  Storyboard.TargetProperty="(UIElement.Clip).(PathGeometry.Figures)[0].(PathFigure.Segments)[1].(LineSegment.Point)"
			SpeedRatio="3">
				<SplinePointKeyFrame KeyTime="00:00:00" Value="0,0"/>
				<SplinePointKeyFrame KeyTime="00:00:01" Value="60,50"/>
			</PointAnimationUsingKeyFrames>

			<PointAnimationUsingKeyFrames BeginTime="00:00:00" 
				  Storyboard.TargetName="expandEffect" 
				  Storyboard.TargetProperty="(UIElement.Clip).(PathGeometry.Figures)[0].(PathFigure.Segments)[2].(LineSegment.Point)"
			SpeedRatio="3">
				<SplinePointKeyFrame KeyTime="00:00:00" Value="0,0"/>
				<SplinePointKeyFrame KeyTime="00:00:01" Value="0,50"/>
			</PointAnimationUsingKeyFrames>
		</Storyboard>
	</UserControl.Resources>

	<Grid x:Name="LayoutRoot" MouseRightButtonDown="LayoutRoot_MouseRightButtonDown"           
		  MouseLeftButtonDown="LayoutRoot_MouseLeftButtonDown">

		<Grid x:Name="GadgetWindow" Background="White" MinWidth="500" MinHeight="30" >
			
			<Rectangle x:Name="GWindow" Style="{StaticResource GWindow}" Stroke="{StaticResource WindowBrush}" StrokeThickness="4" />
			<StackPanel HorizontalAlignment="Left" VerticalAlignment="Top" Margin="13,11,0,20" d:LayoutOverrides="VerticalAlignment, GridBox">
				<TextBlock x:Name="GName" TextWrapping="Wrap" Text="StatCalc - Sample Size and Power" VerticalAlignment="Top" Margin="0,0,26,0" Height="Auto" HorizontalAlignment="Left" Foreground="#FF2B4360" FontSize="21.333"/>

				<Rectangle x:Name="GHeader" VerticalAlignment="Top" Height="4" Margin="0,2,0,0" StrokeThickness="0" Fill="#FF00B050" />	
			</StackPanel>
			<StackPanel HorizontalAlignment="Right" Orientation="Horizontal" VerticalAlignment="Top" Margin="0,9,10,20">
				<Button x:Name="ResizeButton" Content="" Template="{StaticResource resizebtn}" Cursor="Hand" Click="ResizeButton_Click" Width="24" Height="24" >
					<Button.Effect>
						<DropShadowEffect Color="#FFB0B0B0" ShadowDepth="1"/>
					</Button.Effect>
				</Button>
				<Button x:Name="CloseButton1" Content="" Template="{StaticResource CloseButton}" Cursor="Hand" Click="CloseGadget_Click" Width="24" Height="24" >
					<Button.Effect>
						<DropShadowEffect Color="#FFB0B0B0" ShadowDepth="1"/>
					</Button.Effect>
				</Button>
			</StackPanel>
			
			<Grid x:Name="GadgetContentGrid" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,47,0,0">
				<!--<toolkit:Expander x:Name="propertiesExp" Margin="0,-24,33,26" VerticalAlignment="Top" 
				ExpandDirection="Down" IsExpanded="True" Style="{StaticResource ExpanderStyle2}" Canvas.ZIndex="999" HorizontalAlignment="Right" Width="188">

					<toolkit:Expander.Header>
						<TextBlock Text="Edit Properties" FontFamily="Segoe UI" Cursor="Hand" FontSize="12" FontWeight="Bold" TextDecorations="Underline" Foreground="Black"/>
					</toolkit:Expander.Header>
					<Grid Background="Transparent" Margin="0" Width="178">
						<Path Data="M342.5,86.5 L334,100 L350.53125,99.96875 z" Fill="#FF8CC6D3" Height="13.5" Margin="95,-0.5,0,0" Stretch="Fill" Stroke="Gray" StrokeThickness="0" UseLayoutRounding="False" VerticalAlignment="Top" HorizontalAlignment="Left" Width="17"/>

						<Rectangle Fill="#22000000" RadiusX="10" RadiusY="10" Margin="0,13,0,-10" StrokeThickness="0" />
						<Rectangle Fill="#DB6CBBCD" Stroke="Gray"  RadiusX="10" RadiusY="10" Margin="0,13,0,-8" StrokeThickness="0" />
						<Rectangle Fill="#DDFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="3,16,3,-5" />
						<StackPanel Margin="10,22,0,10" VerticalAlignment="Top" HorizontalAlignment="Left">
							<TextBlock x:Name="tblockMainVariable" TextAlignment="Center" Text="Select StatCalc:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,0,0,0"  />
							<ComboBox x:Name="cbxField" Width="140" SelectedIndex="0" Height="25" Margin="5,3,0,0" VerticalAlignment="Top" HorizontalContentAlignment="Left" HorizontalAlignment="Left" SelectionChanged="cbxField_SelectionChanged">
								<ComboBoxItem Content="" />
								<ComboBoxItem Content="Population survey" />
								<ComboBoxItem Content="Cohort or cross-sectional"/>
								<ComboBoxItem Content="Unmatched case-control"/>
							</ComboBox>  
						</StackPanel>
					</Grid>
				</toolkit:Expander>-->
				<StackPanel x:Name="pnlMainContent" Margin="15,10,15,10" Orientation="Vertical">
					<!--<StackPanel x:Name="popSurvey" Visibility="Collapsed">
						<TextBlock TextWrapping="Wrap" Padding="15" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" TextAlignment="Center">Population survey or descriptive study<LineBreak></LineBreak>For simple random sampling, leave design effect and clusters equal to 1.</TextBlock>
						<Grid Height="250">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width=".5*" />
								<ColumnDefinition Width=".5*" />
							</Grid.ColumnDefinitions>
							<Grid Grid.Column="0" HorizontalAlignment="Center">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="110"/>
									<ColumnDefinition Width="130"/>
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition Height="50"/>
									<RowDefinition Height="50"/>
									<RowDefinition Height="50"/>
									<RowDefinition Height="50"/>
									<RowDefinition Height="50"/>
								</Grid.RowDefinitions>
								<TextBlock VerticalAlignment="Center" Grid.Row="0" Grid.Column="0" TextWrapping="Wrap">Population size:</TextBlock>
								<TextBox Grid.Row="0" Grid.Column="1" TextAlignment="Right" Height="30" Width="120" HorizontalAlignment="Right" FontFamily="Microsoft Sans Serif"  FontSize="20" x:Name="txtPopulationSize"></TextBox>
								<TextBlock VerticalAlignment="Center" Grid.Row="1" TextWrapping="Wrap" Grid.ColumnSpan="2" Margin="0,9,103,9" Width="137">Expected frequency:</TextBlock>
								<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
									<TextBox TextAlignment="Right" Height="30" Width="50" FontFamily="Microsoft Sans Serif" FontSize="20" x:Name="txtExpectedFreq"></TextBox>
									<TextBlock VerticalAlignment="Center" FontWeight="Black">&#160;%</TextBlock>
								</StackPanel>
								<TextBlock VerticalAlignment="Center" Grid.Row="2" Grid.Column="0" TextWrapping="Wrap">Confidence limits:</TextBlock>
								<StackPanel Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
									<TextBox TextAlignment="Right" Height="30" Width="50" FontFamily="Microsoft Sans Serif" FontSize="20" x:Name="txtConfidenceLimits"></TextBox>
									<TextBlock VerticalAlignment="Center" FontWeight="Black">&#160;%</TextBlock>
								</StackPanel>
								<TextBlock VerticalAlignment="Center" Grid.Row="3" Grid.Column="0" TextWrapping="Wrap">Design effect:</TextBlock>
								<StackPanel Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
									<TextBox TextAlignment="Right" Height="30" Width="50" FontFamily="Microsoft Sans Serif" FontSize="20" x:Name="txtDesignEffect" Grid.Column="1" Margin="66,9,14,11" Grid.Row="3"></TextBox>
								</StackPanel>
								<TextBlock VerticalAlignment="Center" Grid.Row="4" Grid.Column="0" TextWrapping="Wrap">Clusters:</TextBlock>
								<StackPanel Grid.Row="4" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
									<TextBox TextAlignment="Right" Height="30" Width="50" FontFamily="Microsoft Sans Serif" FontSize="20" x:Name="txtNumberOfClusters" Grid.Column="1" Margin="66,9,14,11" Grid.Row="3"></TextBox>
								</StackPanel>
							</Grid>
							<Grid Grid.Column="1" HorizontalAlignment="Center">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="75" />
									<ColumnDefinition Width="75" />
									<ColumnDefinition Width="75" />
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition Height="35"/>
									<RowDefinition/>
									<RowDefinition/>
									<RowDefinition/>
									<RowDefinition/>
									<RowDefinition/>
									<RowDefinition/>
									<RowDefinition/>
								</Grid.RowDefinitions>
								<Rectangle Grid.Column="0" Grid.Row="0" Style="{StaticResource HeaderCell}"/>
								<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" TextAlignment="Center">Confidence<LineBreak></LineBreak>Level</TextBlock>
								<Rectangle Grid.Column="0" Grid.Row="1" Style="{StaticResource DataCell}"/>
								<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="1">80%</TextBlock>
								<Rectangle Grid.Column="0" Grid.Row="2" Style="{StaticResource DataCell}"/>
								<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="2">90%</TextBlock>
								<Rectangle Grid.Column="0" Grid.Row="3" Style="{StaticResource DataCell}"/>
								<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="3">95%</TextBlock>
								<Rectangle Grid.Column="0" Grid.Row="4" Style="{StaticResource DataCell}"/>
								<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="4">97%</TextBlock>
								<Rectangle Grid.Column="0" Grid.Row="5" Style="{StaticResource DataCell}"/>
								<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="5">99%</TextBlock>
								<Rectangle Grid.Column="0" Grid.Row="6" Style="{StaticResource DataCell}"/>
								<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="6">99.9%</TextBlock>
								<Rectangle Grid.Column="0" Grid.Row="7" Style="{StaticResource DataCell}"/>
								<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="7">99.99%</TextBlock>

								<Rectangle Grid.Column="1" Grid.Row="0" Style="{StaticResource HeaderCell}"/>
								<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Grid.Row="0" FontWeight="Bold"  TextAlignment="Center">Cluster<LineBreak></LineBreak>Size</TextBlock>
								<Rectangle Grid.Column="1" Grid.Row="1" Style="{StaticResource DataCell}"/>
								<TextBlock Name="txt80" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Grid.Row="1" FontWeight="Bold">164</TextBlock>
								<Rectangle Grid.Column="1" Grid.Row="2" Style="{StaticResource DataCell}"/>
								<TextBlock Name="txt90" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Grid.Row="2" FontWeight="Bold">270</TextBlock>
								<Rectangle Grid.Column="1" Grid.Row="3" Style="{StaticResource DataCell}"/>
								<TextBlock Name="txt95" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Grid.Row="3" FontWeight="Bold">384</TextBlock>
								<Rectangle Grid.Column="1" Grid.Row="4" Style="{StaticResource DataCell}"/>
								<TextBlock Name="txt97" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Grid.Row="4" FontWeight="Bold">471</TextBlock>
								<Rectangle Grid.Column="1" Grid.Row="5" Style="{StaticResource DataCell}"/>
								<TextBlock Name="txt99" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Grid.Row="5" FontWeight="Bold">663</TextBlock>
								<Rectangle Grid.Column="1" Grid.Row="6" Style="{StaticResource DataCell}"/>
								<TextBlock Name="txt999" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Grid.Row="6" FontWeight="Bold">1082</TextBlock>
								<Rectangle Grid.Column="1" Grid.Row="7" Style="{StaticResource DataCell}"/>
								<TextBlock Name="txt9999" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Grid.Row="7" FontWeight="Bold">1512</TextBlock>

								<Rectangle Grid.Column="2" Grid.Row="0" Style="{StaticResource HeaderCell}"/>
								<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2" Grid.Row="0" FontWeight="Bold" TextAlignment="Center">Total<LineBreak></LineBreak>Sample</TextBlock>
								<Rectangle Grid.Column="2" Grid.Row="1" Style="{StaticResource DataCell}"/>
								<TextBlock Name="ttxt80" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2" Grid.Row="1" FontWeight="Bold">164</TextBlock>
								<Rectangle Grid.Column="2" Grid.Row="2" Style="{StaticResource DataCell}"/>
								<TextBlock Name="ttxt90" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2" Grid.Row="2" FontWeight="Bold">270</TextBlock>
								<Rectangle Grid.Column="2" Grid.Row="3" Style="{StaticResource DataCell}"/>
								<TextBlock Name="ttxt95" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2" Grid.Row="3" FontWeight="Bold">384</TextBlock>
								<Rectangle Grid.Column="2" Grid.Row="4" Style="{StaticResource DataCell}"/>
								<TextBlock Name="ttxt97" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2" Grid.Edit"4" FontWeight="Bold">471</TextBlock>
								<Rectangle Grid.Column="2" Grid.Row="5" Style="{StaticResource DataCell}"/>
								<TextBlock Name="ttxt99" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2" Grid.Row="5" FontWeight="Bold">663</TextBlock>
								<Rectangle Grid.Column="2" Grid.Row="6" Style="{StaticResource DataCell}"/>
								<TextBlock Name="ttxt999" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2" Grid.Row="6" FontWeight="Bold">1082</TextBlock>
								<Rectangle Grid.Column="2" Grid.Row="7" Style="{StaticResource DataCell}"/>
								<TextBlock Name="ttxt9999" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2" Grid.Row="7" FontWeight="Bold">1512</TextBlock>
							</Grid>
						</Grid>
					</StackPanel>-->
					<!--<StackPanel x:Name="cohort" Visibility="Collapsed">

						<TextBlock Padding="15" FontWeight="Bold" TextWrapping="Wrap" HorizontalAlignment="Center">Unmatched Cohort and Cross-Sectional Studies (Exposed and Nonexposed)</TextBlock>
						<Grid Height="280">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width=".5*" />
								<ColumnDefinition Width=".5*" />
							</Grid.ColumnDefinitions>
							<Grid Grid.Column="0" Margin="0,0,10,0">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width=".65*"/>
									<ColumnDefinition Width=".35*"/>
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition Height="40"/>
									<RowDefinition Height="40"/>
									<RowDefinition Height="40"/>
									<RowDefinition Height="40"/>
									<RowDefinition Height="40"/>
									<RowDefinition Height="40"/>
									<RowDefinition Height="40"/>
								</Grid.RowDefinitions>
								<TextBlock VerticalAlignment="Center" Grid.Row="0" Grid.Column="0" TextWrapping="Wrap">Two-sided confidence level:</TextBlock>
								<ComboBox Grid.Row="0" Grid.Column="1" HorizontalAlignment="Center"  VerticalAlignment="Center" FontFamily="Microsoft Sans Serif"  x:Name="cbxConfidenceLevel" SelectionChanged="cbxConfidenceLevel_SelectionChanged">
									<ComboBoxItem>80%</ComboBoxItem>
									<ComboBoxItem>90%</ComboBoxItem>
									<ComboBoxItem>95%</ComboBoxItem>
									<ComboBoxItem>99%</ComboBoxItem>
									<ComboBoxItem IsSelected="True">99.9%</ComboBoxItem>
									<ComboBoxItem>99.99%</ComboBoxItem>
								</ComboBox>
								<TextBlock VerticalAlignment="Center" Grid.Row="1" Grid.Column="0" TextWrapping="Wrap">Power:</TextBlock>
								<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left"  Orientation="Horizontal">
									<TextBox TextAlignment="Right" Height="30" Width="74" HorizontalAlignment="Left"  FontFamily="Arial Unicode MS" FontSize="20" x:Name="txtPower"></TextBox>
									<TextBlock VerticalAlignment="Center" FontWeight="Black">&#160;%</TextBlock>
								</StackPanel>
								<TextBlock VerticalAlignment="Center" Grid.Row="2" Grid.Column="0" TextWrapping="Wrap">Ratio (Unexposed : Exposed):</TextBlock>
								<TextBox Grid.Row="2" Grid.Column="1" TextAlignment="Right" Height="30" Width="74" HorizontalAlignment="Left"  FontFamily="Arial Unicode MS" FontSize="20" x:Name="txtRatioControlsExposed"></TextBox>
								<TextBlock VerticalAlignment="Center" Grid.Row="3" Grid.Column="0" TextWrapping="Wrap">% outcome in unexposed group:</TextBlock>
								<StackPanel Grid.Row="3" Grid.Column="1" HorizontalAlignment="Left"  Orientation="Horizontal">
									<TextBox TextAlignment="Right" Height="30" Width="74" HorizontalAlignment="Left"  FontFamily="Arial Unicode MS"  FontSize="20" x:Name="txtPctControlsExposed"></TextBox>
									<TextBlock VerticalAlignment="Center" FontWeight="Black">&#160;%</TextBlock>
								</StackPanel>
								<TextBlock VerticalAlignment="Center" Grid.Row="4" Grid.Column="0" TextWrapping="Wrap">Risk ratio:</TextBlock>
								<TextBox Grid.Row="4" Grid.Column="1" TextAlignment="Right" Height="30" Width="74" HorizontalAlignment="Left"  FontFamily="Arial Unicode MS" FontSize="20" x:Name="txtRiskRatio"></TextBox>

								<TextBlock VerticalAlignment="Center" Grid.Row="5" Grid.Column="0" TextWrapping="Wrap">Odds ratio:</TextBlock>
								<TextBox Grid.Row="5" Grid.Column="1" TextAlignment="Right" Height="30" Width="74" HorizontalAlignment="Left"  FontFamily="Arial Unicode MS" FontSize="20" x:Name="txtOddsRatio"></TextBox>

								<TextBlock VerticalAlignment="Center" Grid.Row="6" Grid.Column="0" TextWrapping="Wrap">% outcome in exposed group:</TextBlock>
								<StackPanel Grid.Row="6" Grid.Column="1" HorizontalAlignment="Left"  Orientation="Horizontal">
									<TextBox TextAlignment="Right" Height="30" Width="74" HorizontalAlignment="Left"  FontFamily="Arial Unicode MS"  FontSize="20" x:Name="txtPctCasesWithExposure"></TextBox>
									<TextBlock VerticalAlignment="Center" FontWeight="Black">&#160;%</TextBlock>
								</StackPanel>
							</Grid>
							<Grid Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="75" />
									<ColumnDefinition Width="65" />
									<ColumnDefinition Width="65" />
									<ColumnDefinition Width="65" />
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition Height="30"/>
									<RowDefinition Height="30"/>
									<RowDefinition Height="30"/>
									<RowDefinition Height="30"/>
								</Grid.RowDefinitions>
								<Rectangle Grid.Column="0" Grid.Row="1" Style="{StaticResource HeaderCell}"/>
								<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="1" FontWeight="Bold">Exposed</TextBlock>
								<Rectangle Grid.Column="0" Grid.Row="2" Style="{StaticResource HeaderCell}"/>
								<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="2" FontWeight="Bold">Unexposed</TextBlock>
								<Rectangle Grid.Column="0" Grid.Row="3" Style="{StaticResource HeaderCell}"/>
								<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="3" FontWeight="Bold">Total</TextBlock>

								<Rectangle Grid.Column="1" Grid.Row="0" Style="{StaticResource HeaderCell}"/>
								<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Grid.Row="0" FontWeight="Bold">Kelsey</TextBlock>
								<Rectangle Grid.Column="2" Grid.Row="0" Style="{StaticResource HeaderCell}"/>
								<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2" Grid.Row="0" FontWeight="Bold">Fleiss</TextBlock>
								<Rectangle Grid.Column="3" Grid.Row="0" Style="{StaticResource HeaderCell}"/>
								<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="3" Grid.Row="0" FontWeight="Bold">Fleiss<LineBreak/>w/ CC</TextBlock>

								<Rectangle Grid.Column="1" Grid.Row="1" Style="{StaticResource DataCell}"/>
								<TextBlock Name="txtKelseyCases" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Grid.Row="1">0</TextBlock>
								<Rectangle Grid.Column="1" Grid.Row="2" Style="{StaticResource DataCell}"/>
								<TextBlock Name="txtKelseyControls" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Grid.Row="2">0</TextBlock>
								<Rectangle Grid.Column="1" Grid.Row="3" Style="{StaticResource DataCell}"/>
								<TextBlock Name="txtKelseyTotal" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Grid.Row="3">0</TextBlock>
								<Rectangle Grid.Column="2" Grid.Row="1" Style="{StaticResource DataCell}"/>
								<TextBlock Name="txtFleissCases" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2" Grid.Row="1">0</TextBlock>
								<Rectangle Grid.Column="2" Grid.Row="2" Style="{StaticResource DataCell}"/>
								<TextBlock Name="txtFleissControls" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2" Grid.Row="2">0</TextBlock>
								<Rectangle Grid.Column="2" Grid.Row="3" Style="{StaticResource DataCell}"/>
								<TextBlock Name="txtFleissTotal" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2" Grid.Row="3">0</TextBlock>
								<Rectangle Grid.Column="3" Grid.Row="1" Style="{StaticResource DataCell}"/>
								<TextBlock Name="txtFleissCCCases" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="3" Grid.Row="1">0</TextBlock>
								<Rectangle Grid.Column="3" Grid.Row="2" Style="{StaticResource DataCell}"/>
								<TextBlock Name="txtFleissCCControls" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="3" Grid.Row="2">0</TextBlock>
								<Rectangle Grid.Column="3" Grid.Row="3" Style="{StaticResource DataCell}"/>
								<TextBlock Name="txtFleissCCTotal" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="3" Grid.Row="3">0</TextBlock>
							</Grid>
						</Grid>
					</StackPanel>-->
					<StackPanel x:Name="unmatched" Visibility="Collapsed">
						<TextBlock TextWrapping="Wrap" HorizontalAlignment="Left" Margin="0,0,0,15" FontSize="18.667"><Run Text="Unmatched Case-Control Study (Comparison of ILL and NOT ILL)"/></TextBlock>
						<Grid Height="250">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width=".5*" />
								<ColumnDefinition Width=".5*" />
							</Grid.ColumnDefinitions>
							<Grid Grid.Column="0" Margin="0,0,10,0">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width=".65*"/>
									<ColumnDefinition Width=".35*"/>
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition Height="40"/>
									<RowDefinition Height="40"/>
									<RowDefinition Height="40"/>
									<RowDefinition Height="40"/>
									<RowDefinition Height="40"/>
									<RowDefinition Height="40"/>
								</Grid.RowDefinitions>
								<TextBlock VerticalAlignment="Center" Grid.Row="0" Grid.Column="0" TextWrapping="Wrap"><Run Text="Two-sided confidence level:"/></TextBlock>
								<ComboBox Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" Height="30" Width="74" VerticalAlignment="Center" FontFamily="Microsoft Sans Serif"  x:Name="cbxConfidenceLevelU" SelectionChanged="cbxConfidenceLevel_SelectionChanged">
									<ComboBoxItem Content="80%"/>
									<ComboBoxItem Content="90%"/>
									<ComboBoxItem Content="95%"/>
									<ComboBoxItem Content="99%"/>
									<ComboBoxItem IsSelected="True" Content="99.9%"/>
									<ComboBoxItem Content="99.99%"/>
								</ComboBox>
								<TextBlock VerticalAlignment="Center" Grid.Row="1" Grid.Column="0" TextWrapping="Wrap"><Run Text="Power:"/></TextBlock>
								<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left"  Orientation="Horizontal">
									<TextBox TextAlignment="Right" Height="30" Width="74" HorizontalAlignment="Left" FontSize="16" x:Name="txtPowerU"/>
									<TextBlock VerticalAlignment="Center" FontWeight="Black"><Run Text=" %"/></TextBlock>
								</StackPanel>
								<TextBlock VerticalAlignment="Center" Grid.Row="2" Grid.Column="0" TextWrapping="Wrap"><Run Text="Ratio of controls to cases:"/></TextBlock>
								<TextBox Grid.Row="2" Grid.Column="1" TextAlignment="Right" Height="30" Width="74" HorizontalAlignment="Left" FontSize="16" x:Name="txtRatioControlsExposedU"/>
								<TextBlock VerticalAlignment="Center" Grid.Row="3" Grid.Column="0" TextWrapping="Wrap"><Run Text="Percent of controls exposed:"/></TextBlock>
								<StackPanel Grid.Row="3" Grid.Column="1" HorizontalAlignment="Left"  Orientation="Horizontal">
									<TextBox TextAlignment="Right" Height="30" Width="74" HorizontalAlignment="Left"  FontSize="16" x:Name="txtPctControlsExposedU"/>
									<TextBlock VerticalAlignment="Center" FontWeight="Black"><Run Text=" %"/></TextBlock>
								</StackPanel>
								<TextBlock VerticalAlignment="Center" Grid.Row="4" Grid.Column="0" TextWrapping="Wrap"><Run Text="Odds ratio:"/></TextBlock>
								<TextBox Grid.Row="4" Grid.Column="1" TextAlignment="Right" Height="30" Width="74" HorizontalAlignment="Left" FontSize="16" x:Name="txtOddsRatioU"/>
								<TextBlock VerticalAlignment="Center" Grid.Row="5" Grid.Column="0" TextWrapping="Wrap"><Run Text="Percent of cases with exposure:"/></TextBlock>
								<StackPanel Grid.Row="5" Grid.Column="1" HorizontalAlignment="Left"  Orientation="Horizontal">
									<TextBox TextAlignment="Right" Height="30" Width="74" HorizontalAlignment="Left"  FontSize="16" x:Name="txtPctCasesWithExposureU"/>
									<TextBlock VerticalAlignment="Center" FontWeight="Black"><Run Text=" %"/></TextBlock>
								</StackPanel>
							</Grid>
							<Grid Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="75" />
									<ColumnDefinition Width="65" />
									<ColumnDefinition Width="65" />
									<ColumnDefinition Width="65" />
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition Height="35"/>
									<RowDefinition Height="30"/>
									<RowDefinition Height="30"/>
									<RowDefinition Height="30"/>
								</Grid.RowDefinitions>
								<Rectangle Grid.Column="0" Grid.Row="1" Style="{StaticResource HeaderCell}"/>
								<TextBlock Grid.Column="0" Grid.Row="1" Style="{StaticResource HeaderFont}"><Run Text="Cases"/></TextBlock>
								<Rectangle Grid.Column="0" Grid.Row="2" Style="{StaticResource HeaderCell}"/>
								<TextBlock Grid.Column="0" Grid.Row="2" Style="{StaticResource HeaderFont}" ><Run Text="Controls"/></TextBlock>
								<Rectangle Grid.Column="0" Grid.Row="3" Style="{StaticResource HeaderCell}"/>
								<TextBlock Grid.Column="0" Grid.Row="3" Style="{StaticResource HeaderFont}"><Run Text="Total"/></TextBlock>

								<Rectangle Grid.Column="1" Grid.Row="0" Style="{StaticResource HeaderCell}"/>
								<TextBlock Grid.Column="1" Grid.Row="0" Style="{StaticResource HeaderFont}"><Run Text="Kelsey"/></TextBlock>
								<Rectangle Grid.Column="2" Grid.Row="0" Style="{StaticResource HeaderCell}"/>
								<TextBlock Grid.Column="2" Grid.Row="0" Style="{StaticResource HeaderFont}"><Run Text="Fleiss"/></TextBlock>
								<Rectangle Grid.Column="3" Grid.Row="0" Style="{StaticResource HeaderCell}"/>
								<TextBlock Grid.Column="3" Grid.Row="0" Style="{StaticResource HeaderFont}"><Run Text="Fleiss"/><LineBreak/><Run Text="w/ CC"/></TextBlock>

								<Rectangle Grid.Column="1" Grid.Row="1" Style="{StaticResource DataCell}"/>
								<TextBlock x:Name="txtKelseyCasesU" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Grid.Row="1"><Run Text="0"/></TextBlock>
								<Rectangle Grid.Column="1" Grid.Row="2" Style="{StaticResource DataCell}"/>
								<TextBlock x:Name="txtKelseyControlsU" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Grid.Row="2"><Run Text="0"/></TextBlock>
								<Rectangle Grid.Column="1" Grid.Row="3" Style="{StaticResource DataCell}"/>
								<TextBlock x:Name="txtKelseyTotalU" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Grid.Row="3"><Run Text="0"/></TextBlock>
								<Rectangle Grid.Column="2" Grid.Row="1" Style="{StaticResource DataCell}"/>
								<TextBlock x:Name="txtFleissCasesU" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2" Grid.Row="1"><Run Text="0"/></TextBlock>
								<Rectangle Grid.Column="2" Grid.Row="2" Style="{StaticResource DataCell}"/>
								<TextBlock x:Name="txtFleissControlsU" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2" Grid.Row="2"><Run Text="0"/></TextBlock>
								<Rectangle Grid.Column="2" Grid.Row="3" Style="{StaticResource DataCell}"/>
								<TextBlock x:Name="txtFleissTotalU" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2" Grid.Row="3"><Run Text="0"/></TextBlock>
								<Rectangle Grid.Column="3" Grid.Row="1" Style="{StaticResource DataCell}"/>
								<TextBlock x:Name="txtFleissCCCasesU" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="3" Grid.Row="1"><Run Text="0"/></TextBlock>
								<Rectangle Grid.Column="3" Grid.Row="2" Style="{StaticResource DataCell}"/>
								<TextBlock x:Name="txtFleissCCControlsU" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="3" Grid.Row="2"><Run Text="0"/></TextBlock>
								<Rectangle Grid.Column="3" Grid.Row="3" Style="{StaticResource DataCell}"/>
								<TextBlock x:Name="txtFleissCCTotalU" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="3" Grid.Row="3"><Run Text="0"/></TextBlock>
							</Grid>
						</Grid>
					</StackPanel>
				</StackPanel>
			</Grid>
		</Grid>
		<!--<Button x:Name="gadgetMenu" Content="Gadget Menu" Width="124" Height="30" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="20,93,0,0" Click="Button_Click" Style="{StaticResource GlassButton}" Foreground="White" FontWeight="Bold" FontSize="13.333" MouseEnter="Button_Click" />-->

		<!--<GadgetSelector:Menu x:Name="popupMenu" HorizontalAlignment="Left" VerticalAlignment="Top" ItemSelected="MenuList_ItemSelected" Visibility="Visible" RenderTransformOrigin="0.5,0.5">
				<GadgetSelector:Menu.RenderTransform>
					<CompositeTransform TranslateX="20" TranslateY="-29"/>
				</GadgetSelector:Menu.RenderTransform>
				<GadgetSelector:MenuItem ID="cut" Icon="images/cut.png" Text="Cut" Shortcut="Ctrl+X" />
				<GadgetSelector:MenuItem ID="copy" Icon="images/copy.png" Text="Copy" Shortcut="Ctrl+C" />
				<GadgetSelector:MenuItem ID="paste" Icon="images/paste.png" Text="Paste" Shortcut="Ctrl+V" />
				<GadgetSelector:MenuDivider />
				<GadgetSelector:MenuItem ID="new" Text="New">
					<GadgetSelector:Menu>
						<GadgetSelector:MenuItem ID="pdf" Icon="images/pdf.png" Text="PDF Document" />
						<GadgetSelector:MenuItem ID="excel" Icon="images/xls.png" Text="Excel Spreadsheet" />
						<GadgetSelector:MenuItem ID="word" Icon="images/doc.png" Text="Word Document" />
					</GadgetSelector:Menu>
				</GadgetSelector:MenuItem>
			</GadgetSelector:Menu>-->
	</Grid>
</UserControl>

